#ifndef __UNITFORMAT_H__
#define __UNITFORMAT_H__

#include <sstream>

class Unit;

typedef int UnitAmount;

class UnitFormat
{
  public :
    virtual void unitOutput(std::ostream&, const UnitAmount& amount, const Unit& unit) const = 0;
};

class UnitFormatSeq : UnitFormat
{
  public :
    static UnitFormat& unitFormat();
    virtual void unitOutput(std::ostream&, const UnitAmount& amount, const Unit& unit) const;

  private:
    UnitFormatSeq();
};

class UnitFormatMinUnit : UnitFormat
{
  public :
    static UnitFormat& unitFormat();
    virtual void unitOutput(std::ostream&, const UnitAmount& amount, const Unit& unit) const;

  private:
    UnitFormatMinUnit();
};

#define LENGTH_OUTPUT_BY_SEQ UnitFormatSeq::unitFormat()
#define LENGTH_OUTPUT_BY_MINUNIT UnitFormatMinUnit::unitFormat()

#endif

